//引入封装好的组件
// import Login from "./pages/login";
// import Index from './pages/index'
//引入路由的方法 routes 路由视图   route路线
import { Route, Routes, Navigate } from "react-router-dom";
import { lazy } from 'react'
// 路由懒加载
const Login = lazy(() => import("./pages/login"))
const Index = lazy(() => import('./pages/index'))

function App() {
    return (
        <div className="App">
            {/* 路由出口 */}
            <Routes>
                {/* 一级路由 */}
                <Route path="/login" element={<Login />}></Route>
                <Route path="/index/*" element={<Index />}></Route>
                <Route path="*" element={<Navigate to="/login"></Navigate>}></Route>
                {/* 路由重定向 */}
            </Routes>
        </div>
    );
}

export default App;
